Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> Enter your name: <input type="text" onfocusin="myFunction(this)"> <p>When the input field gets focus, a function is triggered which changes the background-color.</p> <p><strong>Note:</strong> Firefox does not support the onfocusin event</p> <script> function myFunction(x) { x.style.background = "yellow"; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onfocusin by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:29:45 GMT --> </html>
Result:
Try it Yourself - © w3schools.com